package com.base.exception;

class Exc {
	int a = 10;
	int b = 20;
	int i = 10;
}

public class ExceptionDemo01 {

	public static void main(String[] args) {
		// int a = 10;
		// int b = 10;
		// int temp = 0;
		// try {
		// temp = a / b;
		// } catch (ArithmeticException e) {
		// System.out.println(e);
		// }

		Exc exc = null;
		try {
		  int	temp = exc.a/exc.b;
		} catch (NullPointerException e2) {
			System.out.println("空指针异常" + e2);
		} catch (ArithmeticException e2) {
			System.out.println("算数异常:" + e2);
		} finally {
			System.out.println("程序退出");
		}

		// temp = a / b;
		// System.out.println(temp);
		// System.out.println("程序退出");
	}
}